home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / Apps / MOO-1.7.6.src / inc / server.h < prev    next >
Text File  |  1994-11-02  |  3KB  |  95 lines

  1. /******************************************************************************
  2.   Copyright (c) 1992 Xerox Corporation.  All rights reserved.
  3.   Portions of this code were written by Stephen White, aka ghond.
  4.   Use and copying of this software and preparation of derivative works based
  5.   upon this software are permitted.  Any distribution of this software or
  6.   derivative works must comply with all applicable United States export
  7.   control laws.  This software is made available AS IS, and Xerox Corporation
  8.   makes no warranty about the software, its performance or its conformity to
  9.   any specification.  Any person obtaining a copy of this software is requested
  10.   to send their name and post office or electronic mail address to:
  11.     Pavel Curtis
  12.     Xerox PARC
  13.     3333 Coyote Hill Rd.
  14.     Palo Alto, CA 94304
  15.     Pavel@Xerox.Com
  16.  *****************************************************************************/
  17.  
  18. /* server.h */
  19.  
  20. /*
  21.  * This describes the complete set of procedures that a network implementation
  22.  * is expected to use from the rest of the server.  See 'network.h' for the
  23.  * complete set of procedures that a network implementation must provide.
  24.  */
  25.  
  26. #ifndef Server_H
  27. #define Server_H 1
  28.  
  29. #include "config.h"
  30. #include "network.h"
  31.  
  32. typedef struct {
  33.     void       *ptr;
  34. } server_handle;
  35.  
  36. extern server_handle    server_new_connection(network_handle h, int outbound);
  37.                 /* Called by the network whenever a new
  38.                  * player connection is made.  By this call,
  39.                  * the network and server exchange tokens
  40.                  * representing the connection for use in
  41.                  * later calls on each other.  If `outbound' is
  42.                  * true, then the connection is being made from
  43.                  * the server to some external place.
  44.                  */
  45.  
  46. extern void        server_receive_line(server_handle h, const char *line);
  47.                 /* The given line has been received as input
  48.                  * on the specified connection.  'line' does
  49.                  * not end in a newline; any such bytes have
  50.                  * been removed by the network.  The characters
  51.                  * in 'line' are all either spaces or non-
  52.                  * whitespace ASCII characters.
  53.                  */
  54.  
  55. extern void        server_close(server_handle h);
  56.                 /* The specified connection has been broken
  57.                  * for some reason not in the server's control.
  58.                  * Effective immediately, the network will no
  59.                  * longer use the given server_handle and the
  60.                  * server should not use the corresponding
  61.                  * network_handle.
  62.                  */
  63.  
  64. #endif /* Server_H */
  65.  
  66.  
  67. /*
  68.  * The following procedures should not be called by a network implementation;
  69.  * they are exported from the server module to other parts of the program.
  70.  */
  71.  
  72. #include "structures.h"
  73.  
  74. enum Fork_Result { FORK_PARENT, FORK_CHILD, FORK_ERROR };
  75. extern enum Fork_Result    fork_server(const char *subtask_name);
  76.  
  77. extern void    player_connected(Objid old_id, Objid new_id,
  78.                  int is_newly_created);
  79. extern void    notify(Objid player, const char *message);
  80. extern void    boot_player(Objid player);
  81.  
  82. /* $Log: server.h,v $
  83.  * Revision 1.4  1992/10/23  23:03:47  pavel
  84.  * Added copyright notice.
  85.  *
  86.  * Revision 1.3  1992/10/21  03:02:35  pavel
  87.  * Converted to use new automatic configuration system.
  88.  *
  89.  * Revision 1.2  1992/09/08  22:05:35  pjames
  90.  * Removed procedures which are no longer exported.
  91.  *
  92.  * Revision 1.1  1992/07/20  23:23:12  pavel
  93.  * Initial RCS-controlled version.
  94.  */
  95.